// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
// 云函数入口函数
exports.main = async (event, context) => {
    var name = event.name
    var head = event.head
    var text = event.text
    var _openid = event._openid
    var _id = event._id
    var dic = {
        "name": name,
        "head":head,
        "text":text
    }
    db.collection('detail').where({
        _openid:_openid,
        _id:_id
        }).update({
            data: {
                comment: db.command.push([dic])
                }
        })
    return{
        name,
        event,
        dic
    }
}